<?php

namespace App\Module\Api\Controllers;
use App\Module\Api\Controllers\Request\PraiseSwitchRequest;
use App\Module\Api\Validator\PraiseSwitchValidator;
use App\System\Base\Repositories\BaseNotificationRecordRepository;
use App\System\Base\Services\TokenService;

/**
 * 更新消息未读数量
 */
class PraiseSwitchController extends Controller
{
    public function __construct()
    {
        $this->query = new PraiseSwitchRequest();
        parent::__construct();
    }

    public function index()
    {
        (new PraiseSwitchValidator())->check();
        $master_id = TokenService::getMasterId();
        $notification = BaseNotificationRecordRepository::getInstance();
        $notification->updateStatus($this->query,$master_id);
        return apiResponse();
    }
}
